<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
    <script>
        function* gen60(url) {
            console.log('--start--');
            yield fetch(url);
            console.log('--end--');
        }
        console.log('----666----');
        let g60 = gen60('https://www.fastmock.site/mock/ba90f15d75470108ed2c56997636d24d/routertest/api/getPage3data');
        let result = g60.next().value;

        console.log(result);

        result.then(res => {
            console.log('res',res);
            console.log(res.json());
        }).then( data => {
            g60.next();
        }).catch(err => {
            console.log('错误：',err);
        })

    </script>
</body>
</html>